package com.cn.kabalifeuser.ui.service.adapter;

import android.text.TextUtils;

import androidx.annotation.Nullable;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.cn.kabalifeuser.R;
import com.cn.kabalifeuser.ui.service.bean.IndexTypeListBean;
import com.cn.kabalifeuser.utils.GlideUtil;

import java.util.List;

/**
 * Created by 晓林 on 2020/9/8.
 * function:
 */
public class TypeAdapter extends BaseQuickAdapter<IndexTypeListBean.ResultBean, BaseViewHolder> {
    public TypeAdapter(int layoutResId, @Nullable List<IndexTypeListBean.ResultBean> data) {
        super(layoutResId, data);
    }

    @Override
    protected void convert(BaseViewHolder helper, final IndexTypeListBean.ResultBean item) {
        helper.setText(R.id.tv_title, item.getTitle());
        if (!TextUtils.isEmpty(item.getIcon()))
            GlideUtil.ImageLoad(this.mContext, item.getIcon(), helper.getView(R.id.img_icon));
        else GlideUtil.ImageLoad(this.mContext, R.drawable.page_gd, helper.getView(R.id.img_icon));


    }
}

